function trim(value){
	if(value.length < 1)
		return "";
	value = rtrim(value);
	value = ltrim(value);
	return value;
}
function rtrim(value){
	var length = value.length;
	var temp = "";
	if(length < 1)
		return "";
	var pos = length - 1;
	while(pos > -1) {
		if((value.charAt(pos) != String.fromCharCode(32)) && (value.charAt(pos) != String.fromCharCode(10)) && (value.charAt(pos) != String.fromCharCode(13)) && (value.charAt(pos) != String.fromCharCode(9))) {
			temp = value.substring(0,pos+1);
			break;
		}
		pos--;
	}
	return temp;
}
function ltrim(value){
	var length = value.length;
	var temp = "";
	if(length < 1)
		return "";
	var pos = 0;
	while(pos < length){
		if((value.charAt(pos) != String.fromCharCode(32)) && (value.charAt(pos) != String.fromCharCode(10)) && (value.charAt(pos) != String.fromCharCode(13)) && (value.charAt(pos) != String.fromCharCode(9))) {
			temp = value.substring(pos,length);
			break;
		}
		pos++;
	}
	return temp;
}